package IO;

import java.io.*;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2024-06-21
 * Time: 18:48
 */
public class IODemo8 {
    public static void main(String[] args) {

        File file = new File("d:/student.txt");

        try (Scanner sc = new Scanner(file)) {
                while(sc.hasNextLine()) {
                    String line = sc.nextLine();
                    System.out.println(line);
                }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
}
